home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / share / ewl / examples / ewl_tooltip_test.c < prev    next >
C/C++ Source or Header  |  2006-01-09  |  2KB  |  53 lines

  1. #include "ewl_test.h"
  2.  
  3. static Ewl_Widget *tooltip_button;
  4.  
  5. static void
  6. __destroy_tooltip_test_window(Ewl_Widget * w, void *ev_data __UNUSED__,
  7.                         void *user_data __UNUSED__)
  8. {
  9.     ewl_widget_destroy(w);
  10.     ewl_callback_append(tooltip_button, EWL_CALLBACK_CLICKED,
  11.             __create_tooltip_test_window, NULL);
  12. }
  13.  
  14. void
  15. __create_tooltip_test_window(Ewl_Widget * w, void *ev_data __UNUSED__,
  16.                     void *user_data __UNUSED__)
  17. {
  18.     Ewl_Widget     *tooltip_win;
  19.     Ewl_Widget     *tooltip_vbox;
  20.     Ewl_Widget     *button;
  21.  
  22.     tooltip_button = w;
  23.  
  24.     tooltip_win = ewl_window_new();
  25.     ewl_window_title_set(EWL_WINDOW(tooltip_win), "Tooltip Test");
  26.     ewl_window_name_set(EWL_WINDOW(tooltip_win), "EWL Test Application");
  27.     ewl_window_class_set(EWL_WINDOW(tooltip_win), "EFL Test Application");
  28.     ewl_object_size_request(EWL_OBJECT(tooltip_win), 200, 100);
  29.  
  30.     if (w) {
  31.         ewl_callback_del(w, EWL_CALLBACK_CLICKED, 
  32.                     __create_tooltip_test_window);
  33.         ewl_callback_append(tooltip_win, EWL_CALLBACK_DELETE_WINDOW,
  34.                 __destroy_tooltip_test_window, NULL);
  35.     } else
  36.         ewl_callback_append(tooltip_win, EWL_CALLBACK_DELETE_WINDOW,
  37.                     __close_main_window, NULL);
  38.     ewl_widget_show(tooltip_win);
  39.     
  40.     tooltip_vbox = ewl_vbox_new();
  41.     ewl_container_child_append(EWL_CONTAINER(tooltip_win), tooltip_vbox);
  42.     ewl_box_spacing_set(EWL_BOX(tooltip_vbox), 0);
  43.     ewl_widget_show(tooltip_vbox);
  44.  
  45.     button = ewl_button_new();
  46.     ewl_button_label_set(EWL_BUTTON(button), "Hoover on this button");
  47.     ewl_container_child_append(EWL_CONTAINER (tooltip_vbox), button);
  48.     ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
  49.     ewl_attach_tooltip_text_set(button, "and see.");
  50.     ewl_widget_show (button);
  51. }
  52.  
  53.